package com.morpheus.zookeeper.api.election;

import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.leader.LeaderSelectorListener;
import org.apache.curator.framework.state.ConnectionState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ZookeeperLeaderElectionListener implements LeaderSelectorListener {
	private static final Logger LOGGER = LoggerFactory.getLogger(ZookeeperLeaderElectionListener.class);

	public ZookeeperLeaderElectionListener() {
	}

	//zk链接断开时调用此方法
	@Override
	public void stateChanged(CuratorFramework client, ConnectionState newState) {

	}

	//当前节点处于leader状态时调用
	@Override
	public void takeLeadership(CuratorFramework client) throws Exception {

	}
}
